package engine

func Execute(m *Message) {

	var result any
	switch m.Type {
	case MsgTypeCLI:
		result = ExecuteCLI(m)
	case MsgTypeNetconf:
		result = ExecuteNetconf(m)
	case MsgTypeGNMICap:
		result = ExecuteGNMICap(m)
	case MsgTypeGNMIGet:
		result = ExecuteGNMIGet(m)
	case MsgTypeGNMIUpdate:
		result = ExecuteGNMIUpdate(m)
	case MsgTypeGNMIReplace:
		result = ExecuteGNMIReplace(m)
	case MsgTypeGNMIDelete:
		result = ExecuteGNMIDelete(m)
	}

	m.Response <- result
	// 关闭
	close(m.Response)
}
